<div class="app-container with-navbar with-tabbar" ng-controller="PreSalesConfirmController">

    <div class="navbar fixed-top">
        <div class="navbar-left hide-weixin" ng-click="goBack()">
            <img class="button-icon" src="image/nav-left.png"/>

            <div class="button-text">返回</div>
        </div>
        <div class="navbar-title">
            确认订单
        </div>
        <div class="navbar-right">
        </div>
    </div>

    <!-- Address -->
    <div class="confirm-address" ng-click="touchAddress()">
        <div class="address-contact" ng-if="address">
            {{address.receiver_name}}&nbsp;{{address.mobile}}
        </div>
        <div class="address-detail" ng-if="address">
            {{address.province}}
            {{address.city}}
            {{address.district}}
            {{address.full_address}}
        </div>
        <div class="address-create danger" ng-if="!address">
            请填写地址
        </div>
        <img class="address-arrow" src="image/nav-right.png"/>
    </div>

    <!-- Goods -->
    <div class="confirm-goods" ng-if = "selectedGoods">
        <div class="goods-item" ng-click="touchProduct(selectedGoods.product.part_id)">
            <div class="item-photo">
                <img ng-src="image/default-photo.png" lazy-img="{{selectedGoods.product.cover_img}}"/>
            </div>

            <div class="item-info">
                <div class="info-name">
                    {{selectedGoods.product.name}}
                </div>

                <div class="info-price">
                    预付款：{{selectedGoods.product.pre_pay/100| currency:"￥"}}
                </div>
                <div class="info-amount">
                    1
                </div>
            </div>
        </div>

    </div>

    <!-- Form -->
    <div class="confirm-form" ng-if="selectedGoods">
        <div class="form-item" ng-click="touchInvoice()">
            <div class="item-title">
                发票类型
            </div>
            <div class="item-value">不开发票</div>
            <img class="item-arrow" src="image/nav-right.png"/>
        </div>
        <div class="form-item" ng-click="touchExpress()" ng-show="selectedGoods.product">
            <div class="item-title">
                配送方式
            </div>
            <div class="item-value">
                {{express ? express.name + '(' + (express.fee/100 | currency:"￥") + ')' : '选择配送方式'}}
            </div>
            <img class="item-arrow" src="image/nav-right.png"/>
        </div>
        <div class="form-item">
            <div class="item-textarea">
                <textarea type="text" placeholder="买家留言" ng-model="input.comment"  ng-change="refreshComment()"></textarea>
            </div>
        </div>
    </div>

    <!-- Total -->
    <div class="confirm-summury">
        <div class="summury-total">
            订单总额 <span class="total-price">+ {{priceInfo.total_price/100 | currency:"￥"}}</span>
        </div>
        <div class="summury-detail">
            商品总额 <span class="total-price">+ {{priceInfo.goods_price/100| currency:"￥"}}</span>
        </div>
        <div class="summury-detail">

            运费金额 <span class="total-price">+ {{ priceInfo.express_price?( priceInfo.express_price/100 | currency:"￥"):'￥0.00'}}</span>
        </div>
        
    </div>

    <!-- Submit -->
    <div class="confirm-submit">
        <div class="submit-button dark" style="width:100%;" ng-class="{active: canPurchase}" ng-click="touchSubmit()">
            提交订单并支付
        </div>
    </div>

</div>

